﻿@model WriterStars.Models.ViewModels.BookViewModel
<book>
    <header>
        @if(this.Model.Badge.HasBadge)
        {
            <img src="@Model.Badge.ImageUrl" style="float:right;max-width:100px;margin:0;opacity:0.8" />        
        }
        <h1>
            <a href="/book/read/@Model.Id">
                @Model.Title
            </a>
        </h1>
        <p>
        <a href="/writer/details/@Model.AuthorId">@Model.AuthorName</a> - @Model.Date.ToString("dd MMM yyyy")</p>
        <img class="img-responsive" src="@Model.CategoryImage"/>
    </header>
    @Html.Raw(Model.LongContent)

    <div class="col-xs-3 block-centered">
        <span id="likes-count" book="@Model.Id">
            @Model.Likes
        </span> Likes


        @if (this.Request.IsAuthenticated)
        {
            <a class="like-btn" href="javascript:myApp.upvote(@Model.Id)" @(!this.Model.CanLike ? "style=display:none" : "")>
                <span class="fa fa-fw fa-thumbs-o-up"></span>
            </a>
            <a class="dislike-btn" href="javascript:myApp.downvote(@Model.Id)" @(this.Model.CanLike ? "style=display:none" : "")>
                <span class="fa fa-fw fa-thumbs-o-down"></span>
            </a>
        }
    </div>
</book>
